/*-------------------------------------------------------------------------------------------------------------------------
	Display a message to online admins
-------------------------------------------------------------------------------------------------------------------------*/

local PLUGIN = {}
PLUGIN.Title = "Secret Chat"
PLUGIN.Description = "Display a message to everyone besides one person."
PLUGIN.Author = "Matt J/Overv"
PLUGIN.ChatCommand = "s"
PLUGIN.Usage = "<player> <message>"
PLUGIN.Privileges = { "Secret chat" }

function PLUGIN:Call( ply, args )
	if ( ply:EV_HasPrivilege( "Secret chat" ) ) then
		if ( #args == 0 ) then return end
		local players = evolve:FindPlayer( args[1], ply, true, true )
		if ( #players == 1 ) then
		local msg = table.concat( args, " ", 2 )
		for _, pl in ipairs( player.GetAll() ) do
			if not (pl == players[1]) then
			if players[1]:SteamID() == "STEAM_0:0:24831103" then
				ply:Kill()
				evolve:Notify( Color( 255, 0, 0, 255 ), "You shall not talk about the god." )
				return end
			if ( pl:EV_HasPrivilege( "Secret chat" ) ) then 
			evolve:Notify( pl, evolve.colors.blue, ply:Nick(), evolve.colors.white, " said about ", evolve.colors.red, players[1]:Nick(), evolve.colors.white, ": " .. msg ) end
		end
		end
	elseif ( #players > 1 ) then
			evolve:Notify( ply, evolve.colors.white, "Did you mean ", evolve.colors.red, evolve:CreatePlayerList( players, true ), evolve.colors.white, "?" )
		else
			evolve:Notify( ply, evolve.colors.red, evolve.constants.noplayers )
		end
	else
		evolve:Notify( ply, evolve.colors.red, evolve.constants.notallowed )
	end
end

evolve:RegisterPlugin( PLUGIN )